<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="../../../Themes/default/easyui.css">
		<link rel="stylesheet" type="text/css" href="../../../Themes/icon.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/demo.css">
		<link rel="stylesheet" type="text/css" href="../../../CSS/common.css">
		<script type="text/javascript" src="../../../JS/jquery.min.js"></script>
		<script type="text/javascript" src="../../../JS/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="../../../JS/common.js"></script>
		<script type="text/javascript" src='../../../JS/SHA-1.js'></script>
		<script type="text/javascript" src="../../../JS/BasicInfomation.js"></script>
	</head>

	<body style="padding: 0px;">
		<div class="easyui-layout" style="width:100%;height:600px;">
			<div data-options="region:'center'">
				<div>
					<table id="dg" class="table_style">
					</table>
				</div>
			</div>
		</div>
		<div id="toolbar"></div>
		<div id="dlg" class="hiddenDialog">
			<iframe id="ifrmEdit" style="width: 100%;height: 100%;" frameborder="0" scrolling="no"></iframe>
		</div>
	</body>
	<script>
		var currid = getID();
		var content = "";
		var DialogWidth = 750;
		var DialogHeight = 370;
		var AddDialog;
		content = AddToolBar(3 + TOOLBAR_REDO);
		$("#toolbar").append(content);

		/*添加信息*/
		function newdata() {
			var pLocation = "FrozenChargeRatioAdd.html?id=-1";
			$("#ifrmEdit").attr("src", pLocation);
			constructDialog($("#dlg"), "收费类型新增", DialogWidth, DialogHeight);
			AddDialog.dialog('open');
		}

		/*编辑信息*/
		function editdata() {
			var pLocation = "";
			var row = $('#dg').datagrid('getSelected');
			if(!row) {
				$.messager.alert('Info', "请选择你需要修改数据");
				return;
			}
			pLocation = "FrozenChargeRatioAdd.html?id=" + row.ID;
			$("#ifrmEdit").attr("src", pLocation);
			constructDialog($("#dlg"), "收费类型修改", DialogWidth, DialogHeight);
			AddDialog.dialog('open');
		}

		function redodata() {
			checkAllData("/frozen/fees/list.do");
		}

		function dialogClose() {
			AddDialog.dialog('close');
		}

		$('#dg').datagrid({
			url: RemoteLinkAddress + "/frozen/fees/list.do",
			toolbar: '#toolbar',
			method: 'get',
			pagination: 'true',
			rownumbers: 'true',
			fitColumns: 'false',
			singleSelect: 'true',
			height: 350,
			/*表格中的列名以及各自列名的ID*/
			columns: [
				[{
					field: 'ID',
					title: 'ID',
					width: '0%',
					align: 'center'
				}, {
					field: 'CHARGE_NAME',
					title: '收费名称',
					width: '33%',
					align: 'center'
				}, {
					field: 'PRICERANGE',
					title: '收费标准',
					width: '33%',
					align: 'center',
					formatter: function(value, row, index) {
						if(value) {
							return "￥" + value;
						}
					}
				}, {
					field: 'CHARGE_TYPE',
					title: '收费类型',
					width: '33%',
					align: 'center'
				}]
			],
			onDblClickRow: function(index, row) {
				var pLocation = "FrozenChargeRatioAdd.html?ID=" + row.ID;
				$("#ifrmEdit").attr("src", pLocation);
				constructDialog($("#dlg"), "收费类型修改", DialogWidth, DialogHeight);
				AddDialog.dialog('open');
			}
		});
		$('#dg').datagrid('hideColumn', 'ID');
	</script>

</html>